﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace AcessoDados
{
    public class ConnectionFactory
    {

        string _connStr = @"Data Source=(local)\sqlexpress;Initial Catalog=LojaChocolate;Integrated Security=True";//System.IO.File.ReadAllLines("connection.details")[0];

        public SqlConnection criaConexao()
        {
            try
            {
                SqlConnection sqlConn = new SqlConnection(_connStr);
                sqlConn.Open();
                return sqlConn;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
    }
}
